package LeetCode.month02.day51;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

public class No3541 {
    public int maxFreqSum(String s) {
        Set<Character> set = Set.of('a','e','i','o','u');
        int yuan = 0;
        int fu = 0;
        Map<Character,Integer> map = new HashMap<>();
        int n = s.length();
        for (int i = 0; i < n; i++) {
            char c = s.charAt(i);
            int num = map.getOrDefault(c,0)+1;
            if(set.contains(c)){
                yuan = Math.max(yuan,num);
                map.put(c,num);
            }else{
                fu = Math.max(fu,num);
                map.put(c,num);
            }
        }
        return yuan+fu;
    }
}
